<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let s = new Set().add(1).add(2);

        // 键名遍历
        // for(let key of s.keys()){
        //     console.log(key);
        // }

        // 键值遍历
        // for(let value of s.values()){
        //     console.log(value);
        // }

        // 键值对遍历
        // for(let entry of s.entries()){
        //     console.log(entry);//[1,1] 每次打印结果是数组，第一个元素是key,第二个元素是value
        // }

        s.forEach((key, value) => console.log(key, value));



    </script>
</body>
</html>